package cn.afterturn.boot.admin.controller;

import cn.afterturn.boot.bussiness.response.Response;
import cn.afterturn.boot.bussiness.response.SuccessResponse;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * 客户
 *
 * @author by jueyue on 18-7-24.
 */
@Api("用户")
@RestController
@RequestMapping("/cif")
public class CifController {

    private static final Logger LOGGER = LoggerFactory.getLogger(CifController.class);

    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public Response login(@RequestBody Map<String, String> map) {
        Map<String, Object> data = new HashMap<>();
        map.put("token", "iview_admin");
        return new SuccessResponse(data);
    }

    @RequestMapping(value = "/userInfo/{userId}", method = RequestMethod.GET)
    public Response userInfo(@PathVariable String userId) {
        Map<String, Object> map = new HashMap<>();
        map.put("access", new String[]{"admin"});
        map.put("avator", "https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png");
        map.put("user_id", "14138");
        map.put("user_name", "iview_admin");
        return new SuccessResponse(map);
    }

}
